
package com.rx.mgt.dao;  

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.rx.mgt.dao.base.ManagementHibernateDaoBase;
import com.rx.mgt.domain.SysParam;
import com.rx.mgt.domain.UserGroupMapping;

/** 
 * ClassName:UserGroupMappingDao 
 * Function :
 * Reason   : 
 * Date     :Feb 4, 2017 1:49:28 PM 
 * @author   luolei 
 * @since    JDK 1.6
 */
@Repository
public class UserGroupMappingDao  extends ManagementHibernateDaoBase<UserGroupMapping, Long>{
    
    @Transactional(readOnly=true)
    public List<UserGroupMapping> getUserGroupMappingByGropuId(Long groupId){
        String hql ="from  UserGroupMapping an wherean.group_id=:groupId";
        Query query = template.getSessionFactory().getCurrentSession().createQuery(hql);
        query.setParameter("groupId", groupId);
        @SuppressWarnings("unchecked")
        List<UserGroupMapping> list= query.list();
        return list;
    }

}
  